package cn.iocoder.yudao.module.call.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum CallClientEnum {

    OKCC(1L, "okcc", "OKCC"),
    SAN_SAN(2L, "san_san", "三三"), JIU_HUANG(3L, "jiu_huang", "九凰"), BOX(4L, "box", "话机盒子"),

    DFC(5L, "dfc", "数字云"),

    DIAN_YI_WEI_LAI(6L, "dian_yi_wei_lai", "北京点易未来"),
    SIM(7L, "sim", "SIM"),
    CM(8L,"cm","cm话机"),
    JI_XIN(9L,"ji_xin","冀信云通信")
    ;

    /**
     * 编码
     */
    private final Long id;

    private final String code;
    /**
     * 名字
     */
    private final String name;

    public static CallClientEnum getById(Long id) {
        return ArrayUtil.firstMatch(o -> o.getId().equals(id), values());
    }

    public static CallClientEnum getByCode(String code) {
        return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
    }

}
